﻿using Cirrious.MvvmCross.Application;
using Cirrious.MvvmCross.Wpf.Interfaces;
using Cirrious.MvvmCross.Wpf.Platform;
using System.Windows.Threading;
using TeaLightV5.Foundation.UX.Wpf.MvvmCross.Platform;

namespace Conference.UX.Wpf
{
    public class Setup
        : TeaBaseWpfSetup
    {
        public Setup(Dispatcher dispatcher, IMvxWpfViewPresenter presenter)
            : base(dispatcher, presenter)
        {
        }

        protected override MvxApplication CreateApp()
        {
            var app = new Conference.Core.UX.App();
            return app;
        }

        protected override void InitializeDefaultTextSerializer()
        {
            Cirrious.MvvmCross.Plugins.Json.PluginLoader.Instance.EnsureLoaded(true);
        }

        protected override void AddPluginsLoaders(Cirrious.MvvmCross.Platform.MvxLoaderPluginRegistry loaders)
        {
            loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Sqlite.Wpf.Plugin>();
            base.AddPluginsLoaders(loaders);
        }
    }
}